package com.template.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: yanchao
 * @time: 2021-12-29 18:20
 */
public interface ExtraBaseMapper<T> extends BaseMapper<T> {

    /**
     * 根据id往features字段写入数据
     */
    int putFeature(@Param(value = "id") Object id, @Param(value = "key") String key, @Param(value = "value") Object value);

    /**
     * 根据id往features字段写入多个key value数据
     */
    int putFeatures(@Param(value = "id") Object id, @Param(value = "values") Map<String, Object> values);

    /**
     * 根据id和key从features字段查询数据
     */
    Object getFeature(@Param(value = "id") Object id, @Param(value = "key") String key);

    /**
     * 根据id和keys从features字段查询数据
     */
    Map<String, Object> getFeatures(@Param(value = "id") Object id, @Param(value = "keys") List<String> keys);

}
